Refactored keyboard.js