code refactoring & keylistenermanager redesigning