JSMessages: small code simplification