Moved all function out of the global namespece