redefine few functions and templates