Added validation rules and general code cleanup
Added validation rules and general code cleanup