Refactored: spec with json