move validation into form