this seems like worth extracting to method to reduce duplicity