refactor to shorten the `run` method and make it more explicit