added config options for namespaces, little refactoring of functions