Utility functions and global vars class