Applied some API best practice