refactored json transport