inheritance over if