html templating and some css fixes