Split up artifact cache code.