more restructuring and finding bugs