Refactoring for errors check on dynamically added forms