Moved the resources code to includes