refactor render