ast: simplified template copyMethod.