move some utils to math.util
some changes for new EMM realization and new logger