Refactored pose detector.