Move CanExtract check outside of loop
Move power consumption out of resource loop
Formatting