Code repaired for not creating db in GUI
Save before code refactorization

I am going to generalize code and encapsulte into classes.