Did some refactoring and added last of the pull tests.