Added shared.js file for refactor