This was the main point of this PR; these lines have been moved here: https://github.com/dimagi/couchforms/pull/87/files#diff-73058831d969485842825596f9aac109R347.