move json parser to separate class