Fix db issue

see #81
Prepare UI restructuring