Refactors compile out into some sub-functions.