refactor of prompt, completions