Refactor namespace layout and add new architecture for final.