improve question function