re-factor setup dialog