Refactored for more DRY code using partials for form elements.