multiReplace refactored; device tests added