refactored sphinx