Small code tidy & added some unit tests around activation