Export some functions for standalone testing