Refactoring and adding Resource metadatat to files
 Minor refactoring