improve - refactor api