slight refactor + set data context on prefill