can this be extracted to a method?