Clean-up code, add description; add validate_url helper function