performance improvements/simplification