logically split main file into related funcs and types