Removed some obsolete classes, refactored templates a bit.