Replacing static context calls with instance context