Add keyboard events + angularize a small part of code