Optimize faction chat handling by combining for loops