[BD] Refactor code.
Merge branch 'local'