Replace Empty logic with reflect