refactoring to create rule engine independant interface