add resource optimization