some more ideas on restructuring, need to clean it up more yet