moved functionality to base class and added some specs