flatten data object and removed JSON dependencie from code. joinData method added.