Changed the registration of functions from global scope to local scope due namespace pollution;