rendering refactored