BM and CBJ are working + fix resource management