extract renderer to its own file