added better testing for tasks and refined object creation method