added patron dialog, code cleanup