Restructure the backend and then modify the corresponding functions