update forms partials and refactor some code