restructuring and cleanup