Refactor escaping