some refactoring, support for quotes inside quoted string