render/json refactoring