improvements ( added templates hooks )