more fixes for gmf events and code cleanup