Move general code to AbstractTask