fixes auth and cleans up the basics