keyboard functions refactored to separate JS file