renamed method to as_resource