Additional code refactoring