Add rules option. Some cleaning up of sorts.