Reworking the logic to use reflection to invoke the profile. This removes any conditional compilation