Improve getName() method