Open selected files

 - refactored code