Revert "Revert "Do additional preparation in a separate method.""

This reverts commit 7e4c781fe9e93231a03561bdd74b314646957d5e.
Use the right `opts` attribute.