Refactor Tag so that it takes a JSON object