extract path finding in separate utility class in somewhat ugly manner