extracted the execution and the handling of them to a new method