Move $ code to new global block