This whole block (49 lines) can be removed. It may not be hard to make sure `shortname` will always be false now.