some more optimization attempts