Refined linalg class design