refactored to use Legal datatype instead of weird nested Maybe