Wrapped the command check in a class