main functions and namespacing