Trying to remove the amount of global state on svg object