slight efficiency improvement with JSHint