[HG] Refactoring stuff.