minor cleanup
more restructuring