Move logic to the form and rename fields for consistency