Renamed class names,json function made generic