Template refactroing. Unused classes deleted. Added support for any container type. Not tested yet