added tests refactored a smidge