Refactor predb stage 1
Refactor predb stage 1