Is there a way to avoid this copy/paste?