Smart thunkification of an object