fix css style, define templates in js