some changes to better use the API