Refactored check command;