refactoring whole package