Refactor SQLite repository