my solution for the decorator factory