moved form handling into it's own module