Finished refactoring the render method...should be easier to add new functionality now