Added usage and replaced code with template style.