Seperate the code in rules.py into severals classes.
Clear the code.