Replaced inline cls calls to global functions