code cleanup in tasks
added task counter