Improve filename generation