refactor prompt method