first stab at e2e code restructuring