Moved domain logic into it's own namespace