added a control to check when a file exists to avoid warnings
moved internal and conditional assets inside the assets blocks