the handler is now a class, instead of a set of functions and nasty codes
its not stable now, will commit another version in a few hours