Make more generic, Sinatra-fy and remove unneeded bits.