Handle inheritance in a better way