Test fixed and now passing and also refactored a little.