refactored, consolidated, and removed ajax