Refactor master view controller part 1