Use thor tamplate

Split files to template directory.