use object oriented approach and removed unnecessary form validation conditions