move domain structs and related functions out from fileUtil