move events to prototype