Add some helper functions for unit test