prompt() refactored