refactor to use same code style as map box