changed the way ar is loaded to allow caching