added a bit more 'retrieve asset' code, tidy up other bits