continuing main refactor, does not build