Extract broadcast messages codes to separate function.
Extract register username codes to separate function.