Ajax functions now centralized, template work