refactoring extract interface and abstract classs