A bit of refactoring. Extract ID creation.