improved classic API example