Minor refactoring to prepare for more complex artifact attach logic.