refactor base module