API refinements and cleanups