refactor input_conversion method