remove cruft, gate logging on logFlags
begin port of event handlers