Refactors form component