refactor code package