added performance tricks