Moving code from internal project with refactoring.  Not complete