Refactor rules into using lists