Refactored shared variables and updated documentation to clarify usage