remove whitespace
indent code
replace isAuthenticated function with test user existence