webapp event handlers moved to own class and surrounding code refactored to support