AuthHelper added and authentication refactored