Compolete refactoring
Fixed keyboard input
Complete refactoring
Fixed keyboard input