refactoring and some more tests. TODO redis must be mocked out for tests
finish moving namespaces