Refactored keyboard class