Simplify the classes and remove dependency on linear package