refactor membership js form