Code adjustments & performance improvements