Moved methods out of the class as raw functions