Used "that" to work around "this" issue in function calls, also make the code more readable