refactored single analysis