restructure the code

Moving screen capture logic  to a private method.
Changing the screen capture saving location
need to use File.separator here. Otherwise logic will break on Windows