major refactor of structure