Refactor get_form to allow for specifying a form index