refactored rules with a functional approach