Classes, tables and globals - how it all works?