refactor; use json