This is a pretty massive function, as there some ways to break it up?  Could you move it to a service?