Minor perfomance improvements