Refactoring forms and initial js