class refactoring

took steps to modify class to automate the process of reading JSON data
and processing form.