Refactored to expose only public API