Improved class resolution