Abstract build-adding logic to its own function, include check for updating an existing hash