refactored to be added to an object's prototype

also added new event properties