Refactor json

This PR changes the way we convert raw Json to scala