codebase rewritten