fixing a bug with the unit tests and cleaning up methods