Add better Template

Add better Template, more readable, easier to trace the problem. Need to
figure out why sometimes FileWriter not working or setOut method not
working.