Update template derived class
modify it to more flexible