Reworked reasoner implementation