refactored rules