Performance improvements.

Performance boosted and stuff moved around for easier viewing.