Refactor to change surface in a global variable