Minor tweaks and cleanup. Considering a refactor.