Taking namedAfter method out of the if.