appleiap refactoring and build pass