Rename method replaceWhiteSpace to collapseWhiteSpace