refactor on exec