input: small code factorization