added and change some static methods for testing.