improve _basename
improve format