better communication code structure