moving separate gsub methods to be private methods