db class added, more class separation