changed api from protocol to abstract class