refactor screenshot into module