doing optimizations in viewDidLoad