refactor to handle json status input