Changed packages and refactored code