Changed DbFactory to boolean and added dialogs

+minor fixes