Basic validation, form cleanup, code cleanup