made form.php more object-oriented