refactored view class