cleaned up code to use json