Move subset string creation in own method to avoid code duplication