removed unnecessary variable and added a note on the return type in getEntities