fixed dynamic URL
code cleanup/formatting