Migrate some methods from the 4.x version