cleaned up code, form validations