refactor render calls