Compacted code in DBComm to be more efficient