Refactored view class file