rapped code in a closure to hide globally exposed function