refactor base class