fixed fmt formatting issue in main
fixed some poorly structured switchers
fixed passing lock by value issue