completed structural refactor