You should take advantage of the /sockmark and the $sock($sockname).mark identifier in place of numerous variables being set.