Fix bugs from to design pattern change