Removed useless 'mv' and simplified baseName method