Replacing api class variables with instance variables