Code cleanup

We don't need all this static variables anymore.