Refactor for Xcode beta6