Code cleaning + multidimensional diff. update