refactored view rendering