refactoring authentication checking into support method