Refactor to match 4.x