slight code reorganisation ...