refactored .on() method for readability