[WIP] Start refactoring the rules component