refactor base package