import @eddyb's work