refactor of printing structure info