Fragmentize db connection codes for reusability.