Tidied up mod core.