CHORE: Some code refactorings