Updated with current API changes