It makes sense to create a private def which is used instead of copy-pasting the same code snippet.