refactor jquery calls