refactor enumerations with error codes for mclient and vclient