Simplify code and make it compatible with new hygiene