second refactor of structure