Refactor to include JSON.