Extract submit handler