[NF] Code refactoring.