added filtering, moved out tasks to separate file