Use TimerTask to handle input.

Signed-off-by: Mariusz Fik <fisiu@fidano.pl>
Quick code refactoring.

Signed-off-by: Mariusz Fik <fisiu@fidano.pl>