Reorganize codebase