made url shortening optional, and more generic to leave room for other shorteners