Changing BasedOn to take interfaces into account