Implementing non-network mode by optimization of conditional code inclusion