refactoring puffin.screenshot