adjust API to support Contexts