refactor client side package loading