Refactor read_input to use is_a?