Refactored code for entire website