cleaning up listeners, and fixing client template rendering