Fixed integration with refaker (rebased)

The last patch was broken, so I've reworked the issue after rebasing the latest changes.