Some perfomance improvements.