major refactor finalization