It seems hard to use global env during testing.