Refactor Render
remove unused code