Added Keyboard functionality, Refactored