Distributing resources and code