Restructure cumpute db code