moved global functions into a namespace/table