Expose functions for tests