refactored methods out of input loop