This looks like a duplication. Can it be extracted  to a separate method, please?