WIP: begin extracting globals from main