copyObj refactoring - move callbacks out of forEach(...)