Refactor for CherryPy 4.0