Abstracted out the rules