Clean up code by making $share and %args global