refactored rule-file preprocessor