Moved rendering to its own class.