Refactor http module to handle multipart form.