A bit of code refactoring.