Reorganized code a bit.

Simplified update of interactions, by creating a method update(), which takes care
of everything.