Optimise usercount code