cleaning up to make way for a proper MVC framework