Added a helper to create error message
Refactored the whoami command