Separate routines might be best.
Split it up between
16F
18F
18F__J

Unless I am forgetting something that should be the three basic configs.