reactoring input