reorganising code and tests
lol don't remember changes, just tidying up