fix login and general code cleanup /zeus