use generic type to make it possible for materializing result type for the client