Add decorator and factory pattern