struct. refactoring, fixing JSON print