Refactored ViewController.m