refactored view