Moved static fields to the top. Simpler logger initialization. General cleanup.