modify to slightly refactor on DO statement