Changed template parse logic
Removed unused files and add test