smarter class loading