used interface for instanceof instead of abstract class