Exposing some private functions for testing