Adapt to JSR 356, refactor