refactor namespaces and remove code which belongs in other project