Revert "adding tests, and refactorign for ease of testing.""

This reverts commit b88e565d64b89f3d2470336d15c3219096fb1b6f.