Move NTC code to its own translation unit