Helper code that is only used in unit tests