refactored to use async/await for screenshot service, and remove duplication