moved active rule handling to model level