Agreed. Refactor the existing function if it is embedded in a Contribution BAO Utils file so that it resides somewhere more appropriate, like CRM/Utils