Refactoring and link to saved file added