TempRe: Template generation for single and direct multi-step retrosynthesis