A little refactoring and addressed defects.