Refactoring for DatabaseHelper