changing api to better syntax
improving code
improving code