fix 1.8 compatiblity
cleaning up the implementation