replaceAll replaced with a simple function
Merge branch 'master' into cover_transfer