Changed setting name; simplified and optimized some logic