fix refactoring example's usage of static variable