a few more refactorings, slightly faster