refactor initialize method into view class