dynamic redirect uri, beauty and tidy up