Refactor to ConditionalInstantiator
Factor out the compiler for later reuse