Apply notes from Andrey Semashev