some minor improvements based on jshint suggestions
fix including cache variable
useful useContext flag