Better quote handling using replacer function