clean and refactoring form/error