cleaned up core a bit