Removed preprocessor. Refactored code