Refactor run()