refactor namespaces and add docs / license