refactored form