Move selector string generate method to helpers.