add namespace package base

This is just a refactor, it doesn't modify functionality.