Refactor with prompt