Refectoring: second stage.