working on client and tasks, refactoring