Adopt existing code to new Resource API