refactored code package structure