Refactor master view