code cleanup better login