Refactored heloCommand function