Big changes for clean the code for load media files