get rid of defonce macro
refactor into separate namespaces