This just moves the logic from the main method to a lower method in preparation for more refactoring - the effect is still exactly the same: producing a response with BAD_REQUEST and the given message.