Extract as a method
Remove needless loop dependency