refactor seperate templates to variables