JSON reader and writer ready but need some review and refactoring