made entity ownership lookup more generic

Signed-off-by: Jan Dvořák <mordae@anilinux.org>