Add inheritance to observer pattern