rendering refactor