Redesigned mkprompt for cleaner code