fix tabs, leftover from java conversion
optimise in memory db module and fix an issue with pipeline