abstract form handler logic