Converting the APM pattern to tasks