Furthermore a function called hasName could help us because I can see more times this code