added motion event handler templates