move out json stuff @coryvirok