Refactoring according to LibiadaCore.