Moved several (test) environment building functions to a separate file