refactored scripts into site.js