Small optimizations with SQLite helper