authentication refactoring done
curUser method modified