refactor into multiple packages