added templates +minor changes