Refactored. Reduced visibility of methods and sorted classes.