refactore form