[server][DBClientHatohol] Clean up by extracting the commonly used code as a function.