replacing ruby json parsing
dropping ruby dependency and cleaning up a simple if statement