Updated to use a standard keyhandler class