improve fname building API.