restructuring and cosmetic fixes