wow such refactor + AMD/CommonJS compatibility