Did some refactoring for prompt