Split to become both a script and extendable module