Refactor form request handling.