more restructuring and fixing import errors as I find them