json refactored.
tests splitted