refactor to use Trait internally