Refactor into better package structure.