cleanup and bring back some functionalities