breaking off keylistener to separate class