refactor renderer to separate modules