completed refactor in order to support templates fields;
i've completed some unittest but various still lack to be fiexed/aligned