Working on pulling out globals