fixed broken flow; moved task class to its own file