corrected require and simplified code like in README

* [ci skip]
Using after do within a class sample [skip ci]