merged and refactored render code