Refactor frequently-accessed shared variables for reuse