use custom trait to fix tests on 5.4