fixed auth and general cleanup