refactor api and speedwalk