Refactor for Xcode beta 5