Refactoring Preprocessor. Use ternary operator instead of if-else.