TaskQueryService authenticate implementation --> Example8
Some refactoring