optimized the restful#process method