refactor location of modules in file so can be used in validations; clos...

...es #655