factor out string-masking methods
move string-masking logic into Stringmap class