refactoring form component