Database refactoring
gui
merged