tidied up and fixed a typo

-little bit of refacotring