refactor in progress to flatten event handlers