keyboard controller - optimized version
keyboard controller - refactoring