Make templates readable and update to match latest sdk changes
Trim spaces from main file as well