createform split into functions