codereview fixes for 6fad337

cleaned up the decorator
Removed unshortening function from view and put it into its own module.