refactor in progress...