(#228) - refactor idb