refactored all jquery actions in single document