Add util method for unit test