restructure the code

Moving screen capture logic  to a private method.
Changing the screen capture saving location