Refactor db init
Fix paths