Extract count and visibility manipulations to separate reusable chain, use it also after 'clear completed' is clicked