rewrite handlers to look more like event handlers, optional windowless mode