refactor the decorator pattern