Refactoring for and successful app compilation on osx.