cleaned code, tweaked templates styling