refactored task handling in global.asax