Refactored with proper package structure