moved rendering

Moved rendering to its own class