using templates instead of manual html