refactoring for ipad