add refactoring for repositry and form handler