Exposed private functions for testing only. Can be easily removed in build process