Refactoring and include differentiable manifold class