Refactored classes and organized packages