refactor to use base class