let keyboard_manager.js be a object pattern, and purify my code