Removed unnecunnecessary code, improved login funcifunctionality