Made code more module/require friendly-ish