Replace some global calls by instance calls