Modularizing it to simplify code and support instantiation of the SDK, no more static references