laid groundwork for mouse support and cleaned up page creation