refactoring render methods