Major architectural refactor