Changed api + improved way we copy template