Refactoring fix for screen capture.