Removing some of the duplicate logic between path and artifact structs