Fix db file path
Code style tweak
Add insert and transaction sugar