Refactor the code and add the messages for system management.