Some really nice code cleanup after merge