Better use of API functions