Add renderer class and refactor