Refactored form and model handling