Refactoring of responseEntity population