refator form code