restructuring s.js