Refactored the process module to allow better results to be sent back