small validation refactoring fro sqlite driver