restructuring and bug fixes
restructuring and bug fixes