draft: full refactoring