Move Agent.check into separate module