javascript cloure pattern

Avoid polluting the global namespace