refactored to use slqliteDB