refactor of task  service and file handler