Improve db access in NodeManager