move template impl to .h files