factored out common task code into abstract class