Separate the processing of POST from handling the function.