Move code from static initializer into invocable static method.