Refactoring getting screenshot paths in a separate method