Template helpers extracted from Sinatra