Refactor renderer into smaller methods.