code cleanup and google login bug fix