a bit more optimization