change getComponentsForEntities to return object instead of array