Started cleanup and bringing template into Middleman

Bringing template into Middleman to reduce code.