move keyboard input to separate class