Contains form handling logic