cleaned up core