factored each case in ajax_forms.php into a separate source file