Cleanup/refactor long overdure.