Refactor to allow for general JSON blob