do module system refactoring