Fixed indentation
Added resolved URL; changed variables
Compartmentalizing functions