This is my core moodle code to be shared across servers