Fixed all unit tests. We are back to green and refactored