Further code refactoring.