refactoring isn't a bad idea but is quite difficult.
Laws aren't written and can't be written as exactly specified specs.
Laws are written to be interpreted loosely by human judges and applied to a bunch of difficult real world messiness. Not clearly defined interfaces and types.