unification of spaghetti code via classes