Refactoring of computing merged spec