Moved parseBool out of each and cleaned up for loop