moved HasName class to a separate file.