Some improvements, optimizations.