Only expose API

Do not pollute namespace with internal classes and methods.
Only expose the public API and capsulate internal logic with a closure.