Github code restructuring and fixes