Refactored templates structured and added some documentation