clean up code and start moving example over to web_ui