refactoring a JSON aware check into the puts as well