add url media utility and code cleanup