Very rough cut of using json. Refactor!