Refactor language and template