Added the helpers to remove redundancy. Also passed all the tests