restructure: external py for global vars