Major refactor in progress.