refactored code to meet new package structure