refactor prefill for testing (#166)