restructure the code base