More robust way of loading classes.