This commit also refactors a bit logic behind deducing from balance to have better separation of concerns.