Refactor Errors module to namespace