[Refactoring] in app.js, on key press methods.