implement switch for build_form()
clean up switch syntax