optimise vector coercions
more refactoring
tidy dead code