Reformar get name funtion. Add test.