refactor submit