fixed instances where variables were accessed directly from function rather than using interface