get rid of baselib (C code) dependency