wip refactoring of renderer