Modified to remove constructor parameter (context) and retrieve from global

Thank you to Jean-François Cartier for pointing this out.