Majore refactoring.