beginning of db usage and some UI tweaks