Use common function for dealing with qstr